package com.wondertek.poms.core.filter.impl;

import com.wondertek.poms.core.filter.BaseRuleFilter;
import com.wondertek.poms.core.filter.RuleFilterChain;
import com.wondertek.poms.dao.po.Content;
import com.wondertek.poms.dao.po.IRulePo;
import com.wondertek.poms.dao.po.PrdInfoRule;


/**
 * <p><b>CopyRightCpIdFilter Description:</b> 是否输出过滤器</p>
 * @author douzi
 * <b>DATE</b> 2019年9月27日 下午4:00:58
 */
public class OutputFilter extends BaseRuleFilter {

	@Override
	public void doFilter(IRulePo rule, Content c, RuleFilterChain chain) {
		if (rule instanceof PrdInfoRule) {
			PrdInfoRule r = (PrdInfoRule) rule;
			this.baseFilter(r.getPrdRuleId(),
					r.getOutput() == null ? null : r.getOutput() + "",
					c.getOutput(),
					chain,
					"是否输出-Output");
		}

		chain.doFilter(rule, c, chain);
	}

}
